package web_srv

import (
	"gluenet/modules/manager/apiserver/web-srv/agent"
	"gluenet/modules/manager/apiserver/web-srv/configs"
	"gluenet/modules/manager/apiserver/web-srv/index"
	"gluenet/modules/manager/apiserver/web-srv/info"
	"gluenet/modules/manager/apiserver/web-srv/instan-srv"
	"gluenet/modules/manager/apiserver/web-srv/instances"
	"gluenet/modules/manager/apiserver/web-srv/links"
	"gluenet/modules/manager/apiserver/web-srv/monitor"
	"gluenet/modules/manager/apiserver/web-srv/resources"
	"gluenet/pkg/apis"
)

var routers = [][3]interface{}{
	{"GET", apis.InfosGet, info.GetInfo},

	{"GET", apis.ConfigGet, configs.GetConfig},
	{"GET", apis.ConfigList, configs.ListConfigs},
	{"GET", apis.ConfigKindList, configs.ListConfigsKind},

	{"POST", apis.ConfigCreate, configs.CreateConfig},
	{"POST", apis.ConfigHelmCreate, configs.CreateHelmConfig},
	{"GET", apis.ConfigHelmUpdate, configs.CreateHelmUpdate},
	{"GET", apis.ConfigDelete, configs.DeleteConfig},

	{"GET", apis.InstanceGet, instances.GetInstance},
	{"GET", apis.InstanceList, instances.ListInstances},
	{"GET", apis.InstanceKindList, instances.ListInstancesKind},
	{"GET", apis.InstanceListTotal, instances.ListInstancesTotal},
	{"POST", apis.InstanceCreate, instances.CreateInstance},
	{"GET", apis.InstanceDelete, instances.DeleteInstance},

	{"GET", apis.AgentList, agent.ListAgent},
	{"GET", apis.AgentGet, agent.GetAgent},

	{"GET", apis.LinksGet, links.GetStrategyLinks},
	{"GET", apis.UnLinksGet, links.GetStrategyUnLinks},
	{"POST", apis.LinksSet, links.LinkStrategyApplication},

	{"GET", apis.IndexPageGet, index.IndexGet},
	{"GET", apis.IndexPageAdd, index.IndexAdd},
	{"POST", apis.IndexPageSet, index.IndexPut},

	//{"GET", apis.ExampleGet, configs.GetDefaultConfigApplicationLevels},
	//{"GET", apis.ExampleGet, example.ExampleGet},
	//{"GET", apis.GetConfigKinds, strategy.GetConfigKinds},
	//{"GET", apis.GetInstanceStatus, strategy.GetInstanceStatus},
	//{"GET", apis.GetInstanceTypes, strategy.GetInstanceTypes},
	//{"GET", apis.GetNodeTypes, graph.GetNodeTypes},
	//
	//{"GET", apis.GetStrategyConfigLevels, strategy.GetConfigLevels},
	//{"GET", apis.GetStrategyConfig, strategy.GetStrategyConfig},
	//{"GET", apis.ListStrategyConfig, strategy.ListStrategyConfig},
	//{"POST", apis.AddStrategyConfig, strategy.AddStrategyConfig},
	//{"DELETE", apis.DeleteStrategyConfig, strategy.DeleteStrategyConfig},
	//
	//{"GET", apis.GetStrategyInstance, strategy.GetStrategyInstance},
	//{"GET", apis.ListStrategyInstance, strategy.ListStrategyInstance},
	//{"POST", apis.CreateStrategyInstance, strategy.CreateStrategyInstance},

	//{"GET", apis.GetApplicationConfigLevels, application.GetConfigLevels},
	//{"GET", apis.GetApplicationConfig, application.GetApplicationConfig},
	//{"GET", apis.ListApplicationConfig, application.ListApplicationConfig},
	//{"POST", apis.AddApplicationConfig, application.AddApplicationConfig},
	//{"DELETE", apis.DeleteApplicationConfig, application.DeleteApplicationConfig},
	//
	//{"GET", apis.GetApplicationInstance, application.GetApplicationInstance},
	//{"GET", apis.ListApplicationInstance, application.ListApplicationInstance},
	//{"POST", apis.CreateApplicationInstance, application.CreateApplicationInstance},

	//{"GET", interapi.QueryTotalGraph, graph.Total},
	//{"GET", interapi.QueryTotalGraphSub, graph.Sub},
	//{"GET", interapi.QueryDeviceGraph, graph.GetGraphTree},
	{"GET", apis.TotalResources, resources.Resrouce},
	{"GET", apis.TotalGraph, resources.Graph},
	{"GET", apis.TotalGraphLinkerd, resources.GraphLinkerd},

	//{"POST", apis.ExamplePost, example.ExamplePost},
	//{"POST", apis.AddStrategyConfig, strategy.AddStrategyConfig},
	//{"POST", apis.DeleteStrategyConfig, strategy.DeleteStrategyConfig},
	//{"POST", apis.CreateStrategyInstance, strategy.CreateStrategyInstance},

	{"GET", apis.MonitorMetrics, monitor.Metrics},
	{"GET", apis.MonitorMetricsHistoryMethod, monitor.MetricsHistoryMethod},
	{"GET", apis.MonitorMetricsHistorySum, monitor.MetricsHistorySum},
	{"GET", apis.MonitorMetricsList, monitor.MetricsList},
	{"GET", apis.MonitorGetInstances, monitor.ListGuids},
	{"GET", apis.MonitorAllInstances, monitor.ListInstance},
	{"GET", apis.MonitorGetInstanceCpu, monitor.Cpu},
	{"GET", apis.MonitorGetInstanceMem, monitor.Memory},
	//{"GET", apis.MonitorGetInstanceNetRecv, monitor.NetWorkRecv},
	//{"GET", apis.MonitorGetInstanceNetSend, monitor.NetWorkSend},
	{"GET", apis.MonitorGetInstanceCpuSocket, monitor.GetCpuSocket},
	{"GET", apis.MonitorGetInstanceMemSocket, monitor.GetMemorySocket},
	//{"GET", apis.MonitorGetInstanceNetRecvSocket, monitor.GetNetWorkRecvSocket},
	//{"GET", apis.MonitorGetInstanceNetSendSocket, monitor.GetNetWorkSendSocket},

	{"GET", apis.MonitorTraces, monitor.GetTraces},
	//{"POST", apis.MonitorSwitch, monitor.Switch},

	{"GET", apis.Report, instan_srv.InstanceReport},
	{"GET", apis.Proxy, instan_srv.ProxyServiceGet},
}
